{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Siegert neuron integration\n",
    "\n",
    "#### Alexander van Meegen, 2020-12-03\n",
    "\n",
    "This notebook describes how NEST handles the numerical integration of the 'Siegert' function.\n",
    "\n",
    "For an alternative approach, which was implemented in NEST before, see Appendix A.1 in ([Hahne et al., 2017](https://www.frontiersin.org/articles/10.3389/fninf.2017.00034/full#h10)). The current approach seems to be faster and more stable, in particular in the noise-free limit.\n",
    "\n",
    "Let's start with some imports:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from scipy.special import erf, erfcx\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction\n",
    "\n",
    "We want to determine the firing rate of an integrate-and-fire neuron with exponentially decaying post–synaptic currents driven by a mean input $\\mu$ and white noise of strength $\\sigma$. For small synaptic time constant $\\tau_{\\mathrm{s}}$ compared to the membrane time constant $\\tau_{\\mathrm{m}}$, the firing rate is given by the 'Siegert' ([Fourcaud and Brunel, 2002](https://doi.org/10.1162/089976602320264015))\n",
    "\n",
    "$$ \\phi(\\mu,\\sigma)\t=\t\\left(\\tau_{\\mathrm{ref}}+\\tau_{\\mathrm{m}}\\sqrt{\\pi}I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})\\right)^{-1} $$\n",
    "\n",
    "with the refractory period $\\tau_{\\mathrm{ref}}$ and the integral\n",
    "\n",
    "$$ I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})\t=\t\\int_{\\tilde{V}_{\\mathrm{r}}}^{\\tilde{V}_{\\mathrm{th}}}e^{s^{2}}(1+\\mathrm{erf}(s))ds $$\n",
    "\n",
    "involving the shifted and scaled threshold voltage $\\tilde{V}_{\\mathrm{th}}=\\frac{V_{\\mathrm{th}}-\\mu}{\\sigma}+\\frac{\\alpha}{2}\\sqrt{\\frac{\\tau_{\\mathrm{s}}}{\\tau_{\\mathrm{m}}}}$, the shifted and scaled reset voltage $\\tilde{V}_{\\mathrm{r}}=\\frac{V_{\\mathrm{r}}-\\mu}{\\sigma}+\\frac{\\alpha}{2}\\sqrt{\\frac{\\tau_{\\mathrm{s}}}{\\tau_{\\mathrm{m}}}}$, and the constant $\\alpha=\\sqrt{2}\\left|\\zeta(1/2)\\right|$ where $\\zeta(x)$ denotes the Riemann zeta function. \n",
    "\n",
    "Numerically, the integral in $I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})$ is problematic due to the interplay of $e^{s^{2}}$ and $\\mathrm{erf}(s)$ in the integrand. Already for moderate values of $s$, it causes numerical problems (note the order of magnitude):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAENCAYAAAAL98L+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAnVElEQVR4nO3de3wU9dn38c8VlIOCHMQDcm5VFGurmIKHuz5WeRShBYu2kIpFBSIUKGpVoCIeUCoKyikgKKhYBb09UBQQEG9EW9QEUA4iFBFuUxAQtRDCmev5YxefTdjAkt3s7Cbf9+u1L3Z+MzvzzW/JXvnNzM6YuyMiInJIRtABREQktagwiIhIESoMIiJShAqDiIgUocIgIiJFqDCIiEgRKgwiIlKECoOIiBRxXNABROJlZtcAPwXOBv7o7vsCjiSS1jRikLTn7nPc/XGgAKgcdB6RdKfCIGnFzI43sxfM7J9m9pGZ1Qu39wLmuPvOYsv/1cxuDyLrkZhZMzNbamY7zOxP4baYsprZx2Z23tHaREpLhUHSzc+B7e5+KXCxu28ys57AVcA5Zlb70IJmdgrwB2BCeLqPmeWZ2R4zey6A7JHuARa4ew13H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AgQNcdtllDBo0iBtuuEHXNJKkSHRhyAcaRkw3ADYmeBsi5cqWLVuYPXs2M2bMYNasWezevZvGjRtz11130aVLF37yk58EHVEqmEQXhlzgLDNrCvwb6Az8PsHbEElr+/fvZ+nSpbz99tvMnDmTjz/+GHenXr16dO/enaysLC655BLMog3ARcpeqQuDmU0FrgDqmlk+cL+7TzKzPsAcoBIw2d1XJiSpSJravXs3eXl5vPfeeyxcuJB//vOfFBQUYGb8/Oc/58EHH6Rdu3ZceOGFKgaSEuI5KymrhPZZwKxSJxJJY4WFhXz66acsWbKEJUuWsHjxYlauXMn+/fsBOP/88+natSuXX345V1xxBaeeemrAiUUOp0tiiBwjd2fz5s2sXr2azz///Id/P//8c9avX4976KS6unXrctFFF9G2bVtatmzJL37xC12iQtKCCoNIBHdn+/btbN68mY0bN7JhwwY2bNjA//7v/xZ5vmfPnh9ec8IJJ9CsWTNatWpF165dueCCC2jRogUNGjTQriFJSyoMUq7t3buX77777rDHtm3b2Lx5c9RH5If+IaeffjqNGzfmggsuoEOHDjRu3Jizzz6bc845hwYNGpCRoQsVS/mhwiAp58CBA+zcuZOCggJ27NhBQUFBkUdJbd9///1hBaCwsLDE7VSqVIlTTz2V0047jdNOO41zzz33h+ennXYa9erVo1GjRjRs2JCqVasmsQdEgqXCkAZGjx5Ny5Ytufjii5O2TXdn37597N2794fHnj17ijzftWsXu3fvZteuXT88IqePNC/asoWFhRQUFLBr166Yc1apUoXq1atTvXp1atasSe3atTnzzDOpXbv2ER916tTh5JNP1l/6IlGoMKSBfv36AXDaaadx1VVXkZmZya5du6hevTq7du1iz549RT60S/owj3Xenj172LdvX0KyV61alapVq1KtWjWqVatW5PmJJ55I3bp1i7TXqFHjhw/66tWrF5kuPq969eocf/zxCckpIv+fHTqDIpVkZmZ6Xl5e0DFSRiwHMDMyMqhSpQpVqlShcuXKRR6xth3rsoc+4It/4B+arlKliv4iF0kiM1vs7pnxrkcjhjRw4okncuaZZ/LrX/+aVq1a0bx5c+rVq8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ea2anAPDP7PFzxk5ITGA8MIdRvQwjt9rq1+CqivDbh/RxLf5rZvcB+4MUSVlPm/RlFLP0T6P/VH0KYVQdeA2539+3FZi8htDukIHysaTpwVpIjwtHfw5ToSwAzqwy0BwZGmZ0q/RmrUvVrmRYGd29dipflAw0jphsAG6Mst9nM6rn7pvCQc0tpMhZ3tMxmdhzQEbjoCOvYGP53i5m9QWg4l9APslj71syeBt6KMivWfo5LDP3ZFfgVcJWHd4pGWUeZ92cUsfRPUvrwSMzseEJF4UV3f734/MhC4e6zzGycmdV196Re9yeG9zDwvoxwLbDE3TcXn5Eq/RkWy2dgqfo1FXclzQA6m1kVM2tKqBp/XMJyXcPPuwIljUASrTXwubvnR5tpZieaWY1DzwkdYF0RbdmyUmzf7G9K2H4ucJaZNQ3/hdSZUJ8mjZm1AfoD7d29sIRlgurPWPpnBvCH8Bk1FwP/OTS0T4bwsa5JwCp3f6KEZU4PL4eZtST0O78tWRnD243lPQy0L4spcY9AKvRnhFg+A0v3e57so+sRR8t/Q6ia7QE2A3Mi5t1L6Ej6auDaiPZnCJ/BBJwMzAf+Ff63TpJyPwf0LNZ2BjAr/PxHhI78fwqsJLTLJNl9+wKwHFgW/k9Qr3jO8HRbQmeyfBFQzrWE9n9+En48lUr9Ga1/gJ6H3n9Cw/Sc8PzlRJxdl6R8/0Vot8CyiD5sWyxjn3C/fUroAP+lAbzPUd/DVOrLiKwnEPqgrxnRFnh/EipUm4B94c/NbiV9Bibi91zffBYRkSJScVeSiIgESIVBRESKUGEQEZEiVBhERKQIFQYRESlChUFERIpQYRARkSJUGEREpIj/BzxRsP5GJB1tAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = np.linspace(-10, 10, 1001)\n",
    "plt.plot(s, np.exp(s**2) * (1 + erf(s)), c=\"black\")\n",
    "plt.xlim(s[0], s[-1])\n",
    "plt.yscale(\"log\")\n",
    "plt.title(r\"$e^{s^{2}}(1+\\mathrm{erf}(s))$\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The main trick here is to use the [scaled complementary error function](https://en.wikipedia.org/wiki/Error_function#Complementary_error_function)\n",
    "\n",
    "$$\\mathrm{erf}(s)=1-e^{-s^{2}}\\mathrm{erfcx}(s)$$\n",
    "\n",
    "to extract the leading exponential contribution. For positive $s$, we have $0\\le\\mathrm{erfcx}(s)\\le1$, i.e. the exponential contribution is in the prefactor $e^{-s^{2}}$ which nicely cancels with the $e^{s^{2}}$ in the integrand. In the following, we separate three cases according to the sign of $\\tilde{V}_{\\mathrm{th}}$ and $\\tilde{V}_{\\mathrm{r}}$ because for a negative arguments, the integrand simplifies to $e^{s^{2}}(1+\\mathrm{erf}(-s))=\\mathrm{erfcx}(s)$. Eventually, only integrals of $\\mathrm{erfcx}(s)$ for positive $s\\ge0$ need to be solved numerically which are certainly better behaved:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEKCAYAAAAW8vJGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAhQklEQVR4nO3deXRV9d3v8fc3IYEIYVaBIISQxEAgIDPRAhWsQkHpI0NoRa22drLVetfFsU+nddUuqtV7aXU5PX0QyyBSBEEeAyhFijIaJYQQiISxhqECoiQMv/tHTmJOmAJJzt7nnM9rrb2Ss7PP3t/zW3I+/n77t/c25xwiIiKVYrwuQERE/EXBICIiQRQMIiISRMEgIiJBFAwiIhJEwSAiIkEUDCIiEkTBICIiQRQMIjWY2dVmttHMjprZL+q4ryfM7P5abLfGzDLrciyR+mK68lkkmJm9DBxxzv2yjvu5HP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iEkTBICIiQRQMIiISRMEgIiJBFAwiIhJEwSAiIkH+P/g4cgB8BLzwAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = np.linspace(0, 100, 1001)\n",
    "plt.plot(s, erfcx(s), c=\"black\")\n",
    "plt.xlim(s[0], s[-1])\n",
    "plt.yscale(\"log\")\n",
    "plt.title(r\"$\\mathrm{erfcx}(s)$\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Mathematical Reformulation\n",
    "\n",
    "### Strong Inhibition\n",
    "\n",
    "We have to consider three different cases; let us start with strong inhibitory input such that $0<\\tilde{V}_{\\mathrm{r}}<\\tilde{V}_{\\mathrm{th}}$ or equivalently $\\mu<V_{\\mathrm{r}}+\\frac{\\alpha}{2}\\sigma\\sqrt{\\frac{\\tau_{\\mathrm{s}}}{\\tau_{\\mathrm{m}}}}$. In this regime, the error function in the integrand is positive. Expressing it in terms of $\\mathrm{erfcx}(s)$, we get\n",
    "\n",
    "$$I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})=2\\int_{\\tilde{V}_{\\mathrm{r}}}^{\\tilde{V}_{\\mathrm{th}}}e^{s^{2}}ds-\\int_{\\tilde{V}_{\\mathrm{r}}}^{\\tilde{V}_{\\mathrm{th}}}\\mathrm{erfcx}(s)ds. $$\n",
    "\n",
    "The first integral can be solved in terms of the Dawson function $D(s)$, which is bound between $\\pm1$ and conveniently implemented in GSL; the second integral gives a small correction which has to be evaluated numerically. We get\n",
    "\n",
    "$$I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})=2e^{\\tilde{V}_{\\mathrm{th}}^{2}}D(\\tilde{V}_{\\mathrm{th}})-2e^{\\tilde{V}_{\\mathrm{r}}^{2}}D(\\tilde{V}_{\\mathrm{r}})-\\int_{\\tilde{V}_{\\mathrm{r}}}^{\\tilde{V}_{\\mathrm{th}}}\\mathrm{erfcx}(s)ds.$$\n",
    "\n",
    "We extract the leading contribution $e^{\\tilde{V}_{\\mathrm{th}}^{2}}$ from the denominator and arrive at\n",
    "\n",
    "$$\\phi(\\mu,\\sigma)=\\frac{e^{-\\tilde{V}_{\\mathrm{th}}^{2}}}{e^{-\\tilde{V}_{\\mathrm{th}}^{2}}\\tau_{\\mathrm{ref}}+\\tau_{\\mathrm{m}}\\sqrt{\\pi}\\left(2D(\\tilde{V}_{\\mathrm{th}})-2e^{-\\tilde{V}_{\\mathrm{th}}^{2}+\\tilde{V}_{\\mathrm{r}}^{2}}D(\\tilde{V}_{\\mathrm{r}})-e^{-\\tilde{V}_{\\mathrm{th}}^{2}}\\int_{\\tilde{V}_{\\mathrm{r}}}^{\\tilde{V}_{\\mathrm{th}}}\\mathrm{erfcx}(s)ds\\right)}$$\n",
    "\n",
    "as a numerically safe expression for $0<\\tilde{V}_{\\mathrm{r}}<\\tilde{V}_{\\mathrm{th}}$. Extracting $e^{\\tilde{V}_{\\mathrm{th}}^{2}}$ from the denominator reduces the latter to $2\\tau_{\\mathrm{m}}\\sqrt{\\pi}D(\\tilde{V}_{\\mathrm{th}})$ and exponentially small correction terms because $\\tilde{V}_{\\mathrm{r}}<\\tilde{V}_{\\mathrm{th}}$, thereby preventing overflow.\n",
    "\n",
    "### Strong Excitation\n",
    "\n",
    "Now let us consider the case of strong excitatory input such that $\\tilde{V}_{\\mathrm{r}}<\\tilde{V}_{\\mathrm{th}}<0$ or $\\mu>V_{\\mathrm{th}}+\\frac{\\alpha}{2}\\sigma\\sqrt{\\frac{\\tau_{\\mathrm{s}}}{\\tau_{\\mathrm{m}}}}$. In this regime, we can change variables $s\\to-s$ to make the domain of integration positive again. Using $\\mathrm{erf}(-s)=-\\mathrm{erf}(s)$ as well as $\\mathrm{erfcx}(s)$, we get\n",
    "\n",
    "$$I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})=\\int_{|\\tilde{V}_{\\mathrm{th}}|}^{|\\tilde{V}_{\\mathrm{r}}|}\\mathrm{erfcx}(s)ds.$$\n",
    "\n",
    "In particular, there is no exponential contribution involved in this regime. Thus, we get\n",
    "\n",
    "$$\\phi(\\mu,\\sigma)=\\frac{1}{\\tau_{\\mathrm{ref}}+\\tau_{\\mathrm{m}}\\sqrt{\\pi}\\int_{|\\tilde{V}_{\\mathrm{th}}|}^{|\\tilde{V}_{\\mathrm{r}}|}\\mathrm{erfcx}(s)ds}$$\n",
    "\n",
    "as a numerically safe expression for $\\tilde{V}_{\\mathrm{r}}<\\tilde{V}_{\\mathrm{th}}<0$.\n",
    "\n",
    "### Intermediate Regime\n",
    "\n",
    "In the intermediate regime, we have $\\tilde{V}_{\\mathrm{r}}\\le0\\le\\tilde{V}_{\\mathrm{th}}$ or $V_{\\mathrm{r}}+\\frac{\\alpha}{2}\\sigma\\sqrt{\\frac{\\tau_{\\mathrm{s}}}{\\tau_{\\mathrm{m}}}}\\le\\mu\\le V_{\\mathrm{th}}+\\frac{\\alpha}{2}\\sigma\\sqrt{\\frac{\\tau_{\\mathrm{s}}}{\\tau_{\\mathrm{m}}}}$. Thus, we split the integral at zero and use the previous steps for the respective parts to get\n",
    "\n",
    "$$I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})=2e^{\\tilde{V}_{\\mathrm{th}}^{2}}D(\\tilde{V}_{\\mathrm{th}})+\\int_{\\tilde{V}_{\\mathrm{th}}}^{|\\tilde{V}_{\\mathrm{r}}|}\\mathrm{erfcx}(s)ds.$$\n",
    "\n",
    "Note that the sign of the second integral depends on whether $\\left|\\tilde{V}_{\\mathrm{r}}\\right|>\\tilde{V}_{\\mathrm{th}}$ (+) or not (-). Again, we extract the leading contribution $e^{\\tilde{V}_{\\mathrm{th}}^{2}}$ from the denominator and arrive at\n",
    "\n",
    "$$\\phi(\\mu,\\sigma)\t=\t\\frac{e^{-\\tilde{V}_{\\mathrm{th}}^{2}}}{e^{-\\tilde{V}_{\\mathrm{th}}^{2}}\\tau_{\\mathrm{ref}}+\\tau_{\\mathrm{m}}\\sqrt{\\pi}\\left(2D(\\tilde{V}_{\\mathrm{th}})+e^{-\\tilde{V}_{\\mathrm{th}}^{2}}\\int_{\\tilde{V}_{\\mathrm{th}}}^{|\\tilde{V}_{\\mathrm{r}}|}\\mathrm{erfcx}(s)ds\\right)}$$\n",
    "\n",
    "as a numerically safe expressions for $\\tilde{V}_{\\mathrm{r}}\\le0\\le\\tilde{V}_{\\mathrm{th}}$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Noise-free Limit\n",
    "\n",
    "Even the noise-free limit $\\sigma\\ll\\mu$, where the implementation from ([Hahne et al., 2017](https://www.frontiersin.org/articles/10.3389/fninf.2017.00034/full#h10)) eventually breaks, works flawlessly. In this limit, $\\left|\\tilde{V}_{\\mathrm{th}}\\right|\\gg1$ as long as $\\mu\\neq V_{\\mathrm{th}}$; thus, we get both in the 'strong inhibition' and in the 'itermediate' regime $\\phi(\\mu,\\sigma)\\sim e^{-\\tilde{V}_{\\mathrm{th}}^{2}}\\approx0$ for $\\tilde{V}_{\\mathrm{th}}\\ge0$. Accordingly, the only interesting case is the 'strong excitation' regime $\\tilde{V}_{\\mathrm{r}}<\\tilde{V}_{\\mathrm{th}}<0$. Since also $\\left|\\tilde{V}_{\\mathrm{r}}\\right|\\gg1$, the integrand $\\mathrm{erfcx}(s)$ is only evaluated at $s\\gg1$. Using the only the first term of the [asymptotic expansion](https://en.wikipedia.org/wiki/Error_function#Asymptotic_expansion)\n",
    "\n",
    "$$\\mathrm{erfcx}(s)=\\frac{1}{s\\sqrt{\\pi}}\\sum_{n=0}^{\\infty}(-1)^{n}\\frac{(2n-1)!!}{(2s^{2})^{n}}$$\n",
    "\n",
    "leads to the analytically solvable integral\n",
    "\n",
    "$$I(\\tilde{V}_{\\mathrm{th}},\\tilde{V}_{\\mathrm{r}})=\\int_{|\\tilde{V}_{\\mathrm{th}}|}^{|\\tilde{V}_{\\mathrm{r}}|}\\mathrm{erfcx}(s)ds\\approx\\frac{1}{\\sqrt{\\pi}}\\int_{|\\tilde{V}_{\\mathrm{th}}|}^{|\\tilde{V}_{\\mathrm{r}}|}\\frac{1}{s}ds=\\frac{1}{\\sqrt{\\pi}}\\log\\frac{\\left|\\tilde{V}_{\\mathrm{r}}\\right|}{\\left|\\tilde{V}_{\\mathrm{th}}\\right|}.$$\n",
    "\n",
    "Inserting this into $\\phi(\\mu,\\sigma)$ and using $\\tilde{V}_{\\mathrm{th}}\\approx\\frac{V_{\\mathrm{th}}-\\mu}{\\sigma}, \\tilde{V}_{\\mathrm{r}}\\approx\\frac{V_{\\mathrm{r}}-\\mu}{\\sigma}$ yields\n",
    "\n",
    "$$\\phi(\\mu,\\sigma)\\approx\\begin{cases}\n",
    "0 & \\mu\\le V_{\\mathrm{th}}\\\\\n",
    "\\frac{1}{\\tau_{\\mathrm{ref}}+\\tau_{\\mathrm{m}}\\log\\frac{\\mu-V_{\\mathrm{r}}}{\\mu-V_{\\mathrm{th}}}} & \\mu>V_{\\mathrm{th}}\\end{cases}$$\n",
    "\n",
    "[as it should](https://neuronaldynamics.epfl.ch/online/Ch8.S3.html). Thus, as long as the numerical solution of the integral $\\frac{1}{\\sqrt{\\pi}}\\int_{|\\tilde{V}_{\\mathrm{th}}|}^{|\\tilde{V}_{\\mathrm{r}}|}\\frac{1}{s}ds$ is precise, the deterministic limit is also numerically safe.\n",
    "\n",
    "### Relevance of Noise-free Limit\n",
    "\n",
    "Let us briefly estimate for which values the noise-free limit becomes relevant. We have $\\left|\\tilde{V}_{\\mathrm{r}}\\right|>\\left|\\tilde{V}_{\\mathrm{th}}\\right|\\gg1$, thus the integrand $\\mathrm{erfcx}(s)$ is only evaluated for arguments $s>\\left|\\tilde{V}_{\\mathrm{th}}\\right|\\gg1$. Looking at the difference between $\\mathrm{erfcx}(s)$ and the first order asymptotics shown below, we see that the absolute difference to the asymptotics is only $O(10^{-7})$ for moderate values $\\left|\\tilde{V}_{\\mathrm{th}}\\right|\\approx O(100)$. Since we saw above that the noise free limit is equivalent to the first order asymptotics, we can conclude that it is certainly relevant for $\\left|\\tilde{V}_{\\mathrm{th}}\\right|\\approx\\frac{\\mu-V_{\\mathrm{th}}}{\\sigma}\\approx O(100)$; e.g. for $\\mu-V_{\\mathrm{th}}\\approx10$mV a noise strength of $\\sigma\\approx0.1$mV corresponds to the noise-free limit."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEOCAYAAABmVAtTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAA0bUlEQVR4nO3dd1yV9fvH8dfFEhxoKk5UyoETcc/UcuTOzMy0Ybn6alpZlraXaX1N/VlaWq7MHJmZZjly5d57ooi5Byoiggh8fn+AfBEBQcZ9c7iej8d55LnndZ9PnPe51+cWYwxKKaUUgJPVBSillLIPDQWllFLxNBSUUkrF01BQSikVT0NBKaVUPA0FpZRS8TQUlFJKxdNQUEopFU9DIZsTkf0i0szqOpIjItNE5DOr68gusro9RcRXRHaKSKiIDLLT8kRkhIi8lorptohIlfSsS/2PhkI2ISJBIhIuItcTvEoYY6oYY1anY5ktMrjUHOt+Ps/E86SnPe/TW8BqY0w+Y8w4uyxPRLyA54GJqZh8FPDJ/a5L3UlDIXvpYIzJm+B1JqWJRcQlqwrL6HVlZe05XBlgf3oXkqC9MmR5QE/gT2NMeCqmXQg8IiLFM2C9OZ6GQjaX+Jdm3Pu3RWQPECYiLnHvT8ft0h8WkeYiMgMoDSyK2+t4K4llVxKR1SJyNe6wRsck1p14XTVEZEfcuuYA7gmmLyEiv4rIRRE5nvjwQlLLSzR+qIgci1v2AR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7LC8tMyXmmlTmia5cWkZboe2s0v7ZWXbOVL72aHtsrr90jouM9pODx/d2yKbLC8t86Vm2pSmSW5cWofbgR3aLyvbLqXx2a397NB2aZ0vs/72khuX4W1ny8dx3iYi20w6HiunrKNtl71p+2Vf6W07u+8pTLK6AHXftO2yN22/7CtdbWfrPQWllFJZy+57CkoppbKQhoJSSql4GgpKKaXiZctQEJGHRGSyiMyzuhaVOiKSR0Smi8j3ItLD6npU2ujfXPYlIp3i/u5+F5FW95o+y0NBRKaIyAUR2ZdoeGsROSwiR0VkaErLMMYEGmN6ZW6l6l7S2JadgXnGmD5AxywvVt0lLe2nf3P2ksa2WxD3d9cTePpey7ZiT2Ea0DrhABFxBsYDbYDKwDMiUllEqonIH4leRbK+ZJWMaaSyLQFv4GTcZNFZWKNK3jRS337KXqaR9rZ7L258irK87yNjzD8i4pNocF3gqDEmEEBEZgOPG2NGAO2zuESVSmlpS+AUscGwi2x62NLRpLH9DmRxeSoFaWk7ETkIjAT+MsbsuNey7fLHWZL//YqE2C+QkslNLCKFROQ7oIaIDMvs4lSaJNeW84EnReRb7Nutgkqm/fRvLltI7m9vINAC6CIiL99rIXbpJVWSGJbsXXXGmGDgnhunLJFkWxpjwoAXs7oYlWbJtZ/+zdlfcm03DhiX2oXYZU/hFFAqwXtv4IxFtaj00bbM3rT9sq8MaTu7hMJWoLyIPCgibkA3YKHFNan7o22ZvWn7ZV8Z0nZWXJI6C9gI+IrIKRHpZYyJAl4BlgIHgbnGGKsfrqPuQdsye9P2y74ys+20QzyllFLx7HL4SCmllA1oKCillIqnoaCUUiqehoJSSql4GgpKKaXiaSgopZSKp6GglFIqnoaCUkqpeBoKSiml4v0/mYGMTEYNZicAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = np.linspace(0.1, 100, 1000)\n",
    "plt.plot(s, erfcx(s), c=\"black\", label=r\"$\\mathrm{erfcx}(s)$\")\n",
    "plt.plot(s, 1 / (np.sqrt(np.pi) * s), ls=\"--\", label=r\"$1/\\sqrt{\\pi}s$\")\n",
    "plt.xlim(s[0], s[-1])\n",
    "plt.xscale(\"log\")\n",
    "plt.yscale(\"log\")\n",
    "plt.legend()\n",
    "plt.title(r\"First order asymptotics of $\\mathrm{erfcx}(s)$\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEOCAYAAACNY7BQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAvpUlEQVR4nO3deXQUVfbA8e8NSYQBHEYdGFlkB0UgAUJABgkgMAmSoDgaFBQRWZRFcUFcQcUFfzMIiAooyCDK4kpAEBxQwmYkhoRVJLIIbqDiirLe3x/dMJ02CZ10J1VJ7uecPif9qurVrXrVfVP1ql6LqmKMMcacEuZ0AMYYY9zFEoMxxpgcLDEYY4zJwRKDMcaYHCwxGGOMycESgzHGmBwsMRhjjMnBEoMxxpgcynRiEJE9ItLF7XWWVCLSWEQ2isjPIjIikOkislVEOhZ3rIEQkVkiMs7pOEqS4mzPMx1vTtYnIk+IyO0BzPeRiFwczLpCoUwkBhH5QEQOichZTsfiqwwkkVHAB6paWVUnBzJdVS9W1Q8KuqIysC+LXUH3aW7zF7Y9C+lMx5sj9YnIX4EbgGkBzP4v4JHCritUSn1iEJE6wKWAAknORuMMEQkPpKygdQSgNrA1iOnBrr9QQr2u4oy9jAv4eMqPT3uFpD7gRmCJqv4WwLwpQCcROT8E6y08VS3VL+AhYC0wAVjsN20PcC+wDTgEvASU9067B/gC+BnYAVzms9xFwAfAD3gOnCS/Ort4/1aggc+0WcA4798vAyeB34BfgFHe8urAG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t27c+6554Z8vcYYUxwsMQTpt99+Y+XKlaSkpLBo0SK++uorwsLCaN++PYmJiSQlJdGoUaMijcEYY0LJEkMInTx5koyMjNP9EllZWQA0b96c5ORkkpOTqV+/frHFY4wxhVEqE0MoOp9DYe/evSxcuJD58+ezbt06AFq1akVycjLXXHMNtWvXdiw2Y4zJS6lMDKe4adjtzz//nNdee4358+ezYcMGANq2bUtycjJXX301NWrUcDhCY4zxsMTggF27drFgwQLmz59PZmYmIkL79u3p3bs3V111FdWqVXM6RGNMGWaJwWE7duxg/vz5zJ8/n23bthEWFkanTp1ITk6mV69edneTMabYlZjEICIVgeeAo8AHqvrKmZYpCYnB15YtW04niZ07dxIeHk6XLl1ITk7miiuuoEqVKk6HaIwpAxz9BTcRmSkiB0Rki195vIjsEJFsERntLe4FvK6qA4GkYNbrVk2bNuXRRx9lx44dZGRkcOedd/LJJ5/Qv39/qlWrRlJSEnPnzuXw4cNOh2qMMXkKdgjSWUC8b4GIlAOeBRKAJsC1ItIEqAns8852Isj1upqI0KJFC5588kl27dpFWloaQ4cOJSMjg+uuu47zzz+fgQMHsnbtWvuFOmOM6wSVGFQ1FfjerzgWyFbVXap6FJgH9AT240kOQa+3JBERYmNjmTBhAp9//jnvv/8+V155JXPnzqV9+/Y0atSIcePGsXfvXqdDNcYYoGi+oGvwvzMD8CSEGsCbwFUi8jywKK+FRWSQiKSLSPrBgweLIDznhIWF0bFjR2bNmsXXX3/NrFmzqFmzJg8++CB16tThsssuY/bs2fz6669Oh2qMKcOKIjHkNlypquqvqtpfVW/Jr+NZVacDDwMZpXlQu0qVKtGvXz/ef/99du/ezcMPP8yePXvo168ff/vb3+jfvz+rVq3i5MmTTodqjCljiiIx7Adq+byvCXxZkApUdZGqDiorv+lcp04dHnroIbKzs0lNTSU5OZk33niDjh07Ur9+fcaOHXt62HBjjClqRZEYNgANRaSuiEQCvYGUglQgIokiMv3HH38sgvDcS0S49NJLefHFF/nqq694+eWXadCgAY888gj169fnH//4B2+99RbHjh1zOlRjTCkW7O2qc4H1QGMR2S8iA1T1ODAMWAZsBxao6tbgQy1bKlasSN++fXnvvffYs2cPY8aMYdu2bfTq1YvatWvz4IMPWoe1MaZI2JPPJcjx48dZsmQJ06ZNY+nSpQAkJCQwePBgunfvTnh4uMMRGmPcwNEH3IpKWb2UdCbh4eEkJSXxzjvvsHv3bu6//342btxIz549qVOnDmPHjmX//v1Oh2mMKeHsjKGEO3bsGIsXL2batGksX74cESExMZERI0bQqVMn+01rY8ogO2Mo4yIiIrjyyit59913+eyzz7jnnntYu3Ytl112Gc2aNWP69Ok2BIcxpkBcmRjK2u2qoVK3bl0ef/xxPv/8c2bOnElERASDBw+mZs2ajBo1ij179jgdojGmBHBlYjDBqVChAv379ycjI4PU1FS6dOnChAkTqF+/Pr169eL999+3MZqMMXlyZWKwS0mhceq5iAULFrB7927uueceUlNT6dy5My1btuSVV16xZyKMMX/gysRgl5JCr1atWjz++OPs27ePF154gSNHjtC3b1/q1avHv//9b3766SenQzTGuIQrE4MpOhUqVODmm29my5YtLF68mAYNGnDXXXdRq1Yt7r77brvd1RjjzsRgl5KKXlhYGJdffjnvv/8+GzZsoHv37jz99NPUrVuXG264ge3btzsdojHGIa5MDHYpqXjFxMQwd+5csrOzGTZsGG+++SYXX3wx11xzDVlZWU6HZ4wpZq5MDMYZderU4emnn2bPnj3cd999LFu2jOjoaJKSkvjoo4+cDs8YU0wsMZg/OO+8807/qtyjjz7K2rVradOmDd26dSM1NdXp8IwxRcwSg8lTlSpVeOCBB9i7dy//93//x6ZNm4iLi6NDhw4sX77cnoUwppRyZWKwzmd3qVSpEnfddRe7d+9m8uTJ7N69m3/84x+0adOGlJQUSxDGlDKuTAzW+exOFSpUYPjw4WRnZzN9+nS+/fZbevbsSYsWLSxBGFOKuDIxGHc766yzGDhwIJ9++imzZ8/m8OHD9OzZk7Zt27JixQqnwzPGBMkSgym08PBwrr/+erZt23b650i7dOlC586dWb9+vdPhGWMKyRKDCVp4eDgDBgzg008/ZdKkS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iWbtV/JFbK2c1Ni2AA0FJG6IhIJ9AZSHI7JFJy1Y8lm7VdyhaztnLpddS6wHmgsIvtFZICqHgeGAcuA7cACVd3qRHwmMNaOJZu1X8lV1G1ng+gZY4zJwU2XkowxxriAJQZjjDE5WGIwxhiTgyUGY4wxOVhiMMYYk4MlBmOMMTlYYjDGGJODJQZjjDE5WGIwxhiTw/8DrP6W0pQHu1EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s = np.linspace(0.1, 100, 1000)\n",
    "plt.plot(s, 1 / (np.sqrt(np.pi) * s) - erfcx(s), c=\"black\")\n",
    "plt.xlim(s[0], s[-1])\n",
    "plt.xscale(\"log\")\n",
    "plt.yscale(\"log\")\n",
    "plt.title(r\"Absolute error of first order asymptotics of $\\mathrm{erfcx}(s)$\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "-----------------------------\n",
    "### License\n",
    "\n",
    "This file is part of NEST. Copyright (C) 2004 The NEST Initiative\n",
    "\n",
    "NEST is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.\n",
    "\n",
    "NEST is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
